<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
    String path = request.getContextPath();
			String basePath = request.getScheme() + "://"
					+ request.getServerName() + ":" + request.getServerPort()
					+ path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link type="text/css" rel="stylesheet" href="static/assets/css/style.css">
<link type="text/css" rel="stylesheet" href="static/assets/css/css.css">
<script src="static/assets/js/vendor/jquery-1.8.2.min.js"></script>
<script src="static/assets/js/vendor/plugins.js"></script>
<script src="static/assets/js/main.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$("#forpost").click(function() {
			$.post("url/add",{urlSource : $("#urlSource").val()}, 
				function(data, status) {
				var dataArr = data.split("|"); 
				if(dataArr[0]=="1"){
					$("#result").html("<p id='result'>短网址 ：<b class=''><%=basePath%>"+dataArr[1]+"</b></p>");
				}else{
					$("#result").html("<p id='result'>网址有误</p>");
				}
					$("#result").show();
			});
		});
	});
</script>
</head>
<body>
		<div class="box">
			<div class="control-group">
			<div class="controls">
				<input type="text" class="input input-LongSerchBox" name="urlSource"
					id="urlSource" /> <a href="javascript:void(0);"
					class="btn btn btn-primary" id="forpost"> <span>确认</span> </a>
			</div>
		</div>
		<div class="table-cell" id="result" style="display:none"></div>
	</div>
</body>
</html>


